
/*
===============================================================================
                    EntitySpaces Studio by EntitySpaces, LLC
             Persistence Layer and Business Objects for Microsoft .NET
             EntitySpaces(TM) is a legal trademark of EntitySpaces, LLC
                          http://www.entityspaces.net
===============================================================================
EntitySpaces Version : 2012.1.0930.0
EntitySpaces Driver  : SQL
Date Generated       : 2016/11/6 13:45:01
===============================================================================
*/

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Linq;
using System.Data;
using System.ComponentModel;
using System.Xml.Serialization;
using System.Runtime.Serialization;

using EntitySpaces.Core;
using EntitySpaces.Interfaces;
using EntitySpaces.DynamicQuery;



namespace yncTech.BusinessObjects
{
	/// <summary>
	/// Encapsulates the 'Fin_Receipt' table
	/// </summary>

    [DebuggerDisplay("Data = {Debug}")]
	[Serializable]
	[DataContract]
	[KnownType(typeof(FinReceipt))]	
	[XmlType("FinReceipt")]
	public partial class FinReceipt : esFinReceipt
	{	
		[DebuggerBrowsable(DebuggerBrowsableState.RootHidden | DebuggerBrowsableState.Never)]
		protected override esEntityDebuggerView[] Debug
		{
			get { return base.Debug; }
		}

		override public esEntity CreateInstance()
		{
			return new FinReceipt();
		}
		
		#region Static Quick Access Methods
		static public void Delete(System.Decimal receiptID)
		{
			var obj = new FinReceipt();
			obj.ReceiptID = receiptID;
			obj.AcceptChanges();
			obj.MarkAsDeleted();
			obj.Save();
		}

	    static public void Delete(System.Decimal receiptID, esSqlAccessType sqlAccessType)
		{
			var obj = new FinReceipt();
			obj.ReceiptID = receiptID;
			obj.AcceptChanges();
			obj.MarkAsDeleted();
			obj.Save(sqlAccessType);
		}
		#endregion

		
					
		
	
	}



    [DebuggerDisplay("Count = {Count}")]
	[Serializable]
	[CollectionDataContract]
	[XmlType("FinReceiptCollection")]
	public partial class FinReceiptCollection : esFinReceiptCollection, IEnumerable<FinReceipt>
	{
		public FinReceipt FindByPrimaryKey(System.Decimal receiptID)
		{
			return this.SingleOrDefault(e => e.ReceiptID == receiptID);
		}

		
		
		#region WCF Service Class
		
		[DataContract]
		[KnownType(typeof(FinReceipt))]
		public class FinReceiptCollectionWCFPacket : esCollectionWCFPacket<FinReceiptCollection>
		{
			public static implicit operator FinReceiptCollection(FinReceiptCollectionWCFPacket packet)
			{
				return packet.Collection;
			}

			public static implicit operator FinReceiptCollectionWCFPacket(FinReceiptCollection collection)
			{
				return new FinReceiptCollectionWCFPacket() { Collection = collection };
			}
		}
		
		#endregion
		
				
	}



    [DebuggerDisplay("Query = {Parse()}")]
	[Serializable]	
	public partial class FinReceiptQuery : esFinReceiptQuery
	{

        public FinReceiptQuery() : this("FinReceiptQuery")
		{
		}
		public FinReceiptQuery(string joinAlias)
		{
			this.es.JoinAlias = joinAlias;
		}	

		override protected string GetQueryName()
		{
			return "FinReceiptQuery";
		}
		
					
	
		#region Explicit Casts
		
		public static explicit operator string(FinReceiptQuery query)
		{
			return FinReceiptQuery.SerializeHelper.ToXml(query);
		}

		public static explicit operator FinReceiptQuery(string query)
		{
			return (FinReceiptQuery)FinReceiptQuery.SerializeHelper.FromXml(query, typeof(FinReceiptQuery));
		}
		
		#endregion		
	}

	[DataContract]
	[Serializable]
	abstract public partial class esFinReceipt : esEntity
	{
		public esFinReceipt()
		{

		}
		
		#region LoadByPrimaryKey
		public virtual bool LoadByPrimaryKey(System.Decimal receiptID)
		{
			if(this.es.Connection.SqlAccessType == esSqlAccessType.DynamicSQL)
				return LoadByPrimaryKeyDynamic(receiptID);
			else
				return LoadByPrimaryKeyStoredProcedure(receiptID);
		}

		public virtual bool LoadByPrimaryKey(esSqlAccessType sqlAccessType, System.Decimal receiptID)
		{
			if (sqlAccessType == esSqlAccessType.DynamicSQL)
				return LoadByPrimaryKeyDynamic(receiptID);
			else
				return LoadByPrimaryKeyStoredProcedure(receiptID);
		}

		private bool LoadByPrimaryKeyDynamic(System.Decimal receiptID)
		{
			FinReceiptQuery query = new FinReceiptQuery();
			query.Where(query.ReceiptID == receiptID);
			return this.Load(query);
		}

		private bool LoadByPrimaryKeyStoredProcedure(System.Decimal receiptID)
		{
			esParameters parms = new esParameters();
			parms.Add("ReceiptID", receiptID);
			return this.Load(esQueryType.StoredProcedure, this.es.spLoadByPrimaryKey, parms);
		}
		#endregion
		
		#region Properties
		
		
		
		/// <summary>
		/// Maps to Fin_Receipt.ReceiptID
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Decimal? ReceiptID
		{
			get
			{
				return base.GetSystemDecimal(FinReceiptMetadata.ColumnNames.ReceiptID);
			}
			
			set
			{
				if(base.SetSystemDecimal(FinReceiptMetadata.ColumnNames.ReceiptID, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.ReceiptID);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.DocumentsNo
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String DocumentsNo
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.DocumentsNo);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.DocumentsNo, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.DocumentsNo);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.Reference
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String Reference
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.Reference);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.Reference, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.Reference);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.ReferenceKey
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String ReferenceKey
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.ReferenceKey);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.ReferenceKey, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.ReferenceKey);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.DocumentsType
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String DocumentsType
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.DocumentsType);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.DocumentsType, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.DocumentsType);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.PostingDate
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.DateTime? PostingDate
		{
			get
			{
				return base.GetSystemDateTime(FinReceiptMetadata.ColumnNames.PostingDate);
			}
			
			set
			{
				if(base.SetSystemDateTime(FinReceiptMetadata.ColumnNames.PostingDate, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.PostingDate);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.CompanyCode
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String CompanyCode
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.CompanyCode);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.CompanyCode, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.CompanyCode);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.RevesedBy
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String RevesedBy
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.RevesedBy);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.RevesedBy, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.RevesedBy);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.ReverseDate
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.DateTime? ReverseDate
		{
			get
			{
				return base.GetSystemDateTime(FinReceiptMetadata.ColumnNames.ReverseDate);
			}
			
			set
			{
				if(base.SetSystemDateTime(FinReceiptMetadata.ColumnNames.ReverseDate, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.ReverseDate);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.UserName
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String UserName
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.UserName);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.UserName, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.UserName);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.DocumentHeaderText
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String DocumentHeaderText
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.DocumentHeaderText);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.DocumentHeaderText, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.DocumentHeaderText);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.DocumentDate
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.DateTime? DocumentDate
		{
			get
			{
				return base.GetSystemDateTime(FinReceiptMetadata.ColumnNames.DocumentDate);
			}
			
			set
			{
				if(base.SetSystemDateTime(FinReceiptMetadata.ColumnNames.DocumentDate, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.DocumentDate);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.ReferenceTransact
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String ReferenceTransact
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.ReferenceTransact);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.ReferenceTransact, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.ReferenceTransact);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.LogicalSystem
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String LogicalSystem
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.LogicalSystem);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.LogicalSystem, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.LogicalSystem);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.FunctionDept
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String FunctionDept
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.FunctionDept);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.FunctionDept, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.FunctionDept);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.StorageStatus
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String StorageStatus
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.StorageStatus);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.StorageStatus, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.StorageStatus);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.EStorageStatus
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String EStorageStatus
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.EStorageStatus);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.EStorageStatus, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.EStorageStatus);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.StorageLocation
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Decimal? StorageLocation
		{
			get
			{
				return base.GetSystemDecimal(FinReceiptMetadata.ColumnNames.StorageLocation);
			}
			
			set
			{
				if(base.SetSystemDecimal(FinReceiptMetadata.ColumnNames.StorageLocation, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.StorageLocation);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.SupplierBarcode
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String SupplierBarcode
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.SupplierBarcode);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.SupplierBarcode, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.SupplierBarcode);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.IsSAP
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Boolean? IsSAP
		{
			get
			{
				return base.GetSystemBoolean(FinReceiptMetadata.ColumnNames.IsSAP);
			}
			
			set
			{
				if(base.SetSystemBoolean(FinReceiptMetadata.ColumnNames.IsSAP, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.IsSAP);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.Comments
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String Comments
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.Comments);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.Comments, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.Comments);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.IsConfirmed
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Boolean? IsConfirmed
		{
			get
			{
				return base.GetSystemBoolean(FinReceiptMetadata.ColumnNames.IsConfirmed);
			}
			
			set
			{
				if(base.SetSystemBoolean(FinReceiptMetadata.ColumnNames.IsConfirmed, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.IsConfirmed);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.ConfirmedBy
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String ConfirmedBy
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.ConfirmedBy);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.ConfirmedBy, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.ConfirmedBy);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.ConfirmedDttm
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.DateTime? ConfirmedDttm
		{
			get
			{
				return base.GetSystemDateTime(FinReceiptMetadata.ColumnNames.ConfirmedDttm);
			}
			
			set
			{
				if(base.SetSystemDateTime(FinReceiptMetadata.ColumnNames.ConfirmedDttm, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.ConfirmedDttm);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.Division
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String Division
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.Division);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.Division, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.Division);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.FirstStorageDate
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.DateTime? FirstStorageDate
		{
			get
			{
				return base.GetSystemDateTime(FinReceiptMetadata.ColumnNames.FirstStorageDate);
			}
			
			set
			{
				if(base.SetSystemDateTime(FinReceiptMetadata.ColumnNames.FirstStorageDate, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.FirstStorageDate);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.VoucherDate
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String VoucherDate
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.VoucherDate);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.VoucherDate, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.VoucherDate);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.VoucherDescription
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String VoucherDescription
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.VoucherDescription);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.VoucherDescription, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.VoucherDescription);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.TransferRecord
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Int32? TransferRecord
		{
			get
			{
				return base.GetSystemInt32(FinReceiptMetadata.ColumnNames.TransferRecord);
			}
			
			set
			{
				if(base.SetSystemInt32(FinReceiptMetadata.ColumnNames.TransferRecord, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.TransferRecord);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.LastTransferDate
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.DateTime? LastTransferDate
		{
			get
			{
				return base.GetSystemDateTime(FinReceiptMetadata.ColumnNames.LastTransferDate);
			}
			
			set
			{
				if(base.SetSystemDateTime(FinReceiptMetadata.ColumnNames.LastTransferDate, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.LastTransferDate);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.DocumentSystem
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String DocumentSystem
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.DocumentSystem);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.DocumentSystem, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.DocumentSystem);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.CreatedBy
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String CreatedBy
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.CreatedBy);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.CreatedBy, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.CreatedBy);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.CreatedDttm
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.DateTime? CreatedDttm
		{
			get
			{
				return base.GetSystemDateTime(FinReceiptMetadata.ColumnNames.CreatedDttm);
			}
			
			set
			{
				if(base.SetSystemDateTime(FinReceiptMetadata.ColumnNames.CreatedDttm, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.CreatedDttm);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.UpdatedBy
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String UpdatedBy
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.UpdatedBy);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.UpdatedBy, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.UpdatedBy);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.UpdatedDttm
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.DateTime? UpdatedDttm
		{
			get
			{
				return base.GetSystemDateTime(FinReceiptMetadata.ColumnNames.UpdatedDttm);
			}
			
			set
			{
				if(base.SetSystemDateTime(FinReceiptMetadata.ColumnNames.UpdatedDttm, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.UpdatedDttm);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.VersionNo
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Int32? VersionNo
		{
			get
			{
				return base.GetSystemInt32(FinReceiptMetadata.ColumnNames.VersionNo);
			}
			
			set
			{
				if(base.SetSystemInt32(FinReceiptMetadata.ColumnNames.VersionNo, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.VersionNo);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.TransactionID
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String TransactionID
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.TransactionID);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.TransactionID, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.TransactionID);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.BoxID
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Decimal? BoxID
		{
			get
			{
				return base.GetSystemDecimal(FinReceiptMetadata.ColumnNames.BoxID);
			}
			
			set
			{
				if(base.SetSystemDecimal(FinReceiptMetadata.ColumnNames.BoxID, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.BoxID);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.DestoryDate
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.DateTime? DestoryDate
		{
			get
			{
				return base.GetSystemDateTime(FinReceiptMetadata.ColumnNames.DestoryDate);
			}
			
			set
			{
				if(base.SetSystemDateTime(FinReceiptMetadata.ColumnNames.DestoryDate, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.DestoryDate);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.HisIndexStart
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String HisIndexStart
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.HisIndexStart);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.HisIndexStart, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.HisIndexStart);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.HisIndexEnd
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String HisIndexEnd
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.HisIndexEnd);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.HisIndexEnd, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.HisIndexEnd);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.HisDocumentStartDate
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String HisDocumentStartDate
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.HisDocumentStartDate);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.HisDocumentStartDate, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.HisDocumentStartDate);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.HisDocumentEndDate
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String HisDocumentEndDate
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.HisDocumentEndDate);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.HisDocumentEndDate, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.HisDocumentEndDate);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.StoreStartDate
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.DateTime? StoreStartDate
		{
			get
			{
				return base.GetSystemDateTime(FinReceiptMetadata.ColumnNames.StoreStartDate);
			}
			
			set
			{
				if(base.SetSystemDateTime(FinReceiptMetadata.ColumnNames.StoreStartDate, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.StoreStartDate);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.NeedStoreYear
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Int32? NeedStoreYear
		{
			get
			{
				return base.GetSystemInt32(FinReceiptMetadata.ColumnNames.NeedStoreYear);
			}
			
			set
			{
				if(base.SetSystemInt32(FinReceiptMetadata.ColumnNames.NeedStoreYear, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.NeedStoreYear);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.UploadId
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Decimal? UploadId
		{
			get
			{
				return base.GetSystemDecimal(FinReceiptMetadata.ColumnNames.UploadId);
			}
			
			set
			{
				if(base.SetSystemDecimal(FinReceiptMetadata.ColumnNames.UploadId, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.UploadId);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.CompanyNo
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String CompanyNo
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.CompanyNo);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.CompanyNo, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.CompanyNo);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.CompanyName
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String CompanyName
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.CompanyName);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.CompanyName, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.CompanyName);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.EntryDate
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.DateTime? EntryDate
		{
			get
			{
				return base.GetSystemDateTime(FinReceiptMetadata.ColumnNames.EntryDate);
			}
			
			set
			{
				if(base.SetSystemDateTime(FinReceiptMetadata.ColumnNames.EntryDate, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.EntryDate);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.UploadUserName
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String UploadUserName
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.UploadUserName);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.UploadUserName, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.UploadUserName);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.UploadDateTime
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.DateTime? UploadDateTime
		{
			get
			{
				return base.GetSystemDateTime(FinReceiptMetadata.ColumnNames.UploadDateTime);
			}
			
			set
			{
				if(base.SetSystemDateTime(FinReceiptMetadata.ColumnNames.UploadDateTime, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.UploadDateTime);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.EStorageLocation
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String EStorageLocation
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.EStorageLocation);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.EStorageLocation, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.EStorageLocation);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.ManageUser
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String ManageUser
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.ManageUser);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.ManageUser, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.ManageUser);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.IsDeleted
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Boolean? IsDeleted
		{
			get
			{
				return base.GetSystemBoolean(FinReceiptMetadata.ColumnNames.IsDeleted);
			}
			
			set
			{
				if(base.SetSystemBoolean(FinReceiptMetadata.ColumnNames.IsDeleted, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.IsDeleted);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.ThirdUnitCabinId
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Guid? ThirdUnitCabinId
		{
			get
			{
				return base.GetSystemGuid(FinReceiptMetadata.ColumnNames.ThirdUnitCabinId);
			}
			
			set
			{
				if(base.SetSystemGuid(FinReceiptMetadata.ColumnNames.ThirdUnitCabinId, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.ThirdUnitCabinId);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.ThirdUnitNumberId
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Guid? ThirdUnitNumberId
		{
			get
			{
				return base.GetSystemGuid(FinReceiptMetadata.ColumnNames.ThirdUnitNumberId);
			}
			
			set
			{
				if(base.SetSystemGuid(FinReceiptMetadata.ColumnNames.ThirdUnitNumberId, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.ThirdUnitNumberId);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.IsHis
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Boolean? IsHis
		{
			get
			{
				return base.GetSystemBoolean(FinReceiptMetadata.ColumnNames.IsHis);
			}
			
			set
			{
				if(base.SetSystemBoolean(FinReceiptMetadata.ColumnNames.IsHis, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.IsHis);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.LendId
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Decimal? LendId
		{
			get
			{
				return base.GetSystemDecimal(FinReceiptMetadata.ColumnNames.LendId);
			}
			
			set
			{
				if(base.SetSystemDecimal(FinReceiptMetadata.ColumnNames.LendId, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.LendId);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.UpdateCount
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Int32? UpdateCount
		{
			get
			{
				return base.GetSystemInt32(FinReceiptMetadata.ColumnNames.UpdateCount);
			}
			
			set
			{
				if(base.SetSystemInt32(FinReceiptMetadata.ColumnNames.UpdateCount, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.UpdateCount);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Receipt.DeleteReason
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String DeleteReason
		{
			get
			{
				return base.GetSystemString(FinReceiptMetadata.ColumnNames.DeleteReason);
			}
			
			set
			{
				if(base.SetSystemString(FinReceiptMetadata.ColumnNames.DeleteReason, value))
				{
					OnPropertyChanged(FinReceiptMetadata.PropertyNames.DeleteReason);
				}
			}
		}		
		
		#endregion	

		#region .str() Properties
		
		public override void SetProperties(IDictionary values)
		{
			foreach (string propertyName in values.Keys)
			{
				this.SetProperty(propertyName, values[propertyName]);
			}
		}
		
		public override void SetProperty(string name, object value)
		{
			esColumnMetadata col = this.Meta.Columns.FindByPropertyName(name);
			if (col != null)
			{
				if(value == null || value is System.String)
				{				
					// Use the strongly typed property
					switch (name)
					{							
						case "ReceiptID": this.str().ReceiptID = (string)value; break;							
						case "DocumentsNo": this.str().DocumentsNo = (string)value; break;							
						case "Reference": this.str().Reference = (string)value; break;							
						case "ReferenceKey": this.str().ReferenceKey = (string)value; break;							
						case "DocumentsType": this.str().DocumentsType = (string)value; break;							
						case "PostingDate": this.str().PostingDate = (string)value; break;							
						case "CompanyCode": this.str().CompanyCode = (string)value; break;							
						case "RevesedBy": this.str().RevesedBy = (string)value; break;							
						case "ReverseDate": this.str().ReverseDate = (string)value; break;							
						case "UserName": this.str().UserName = (string)value; break;							
						case "DocumentHeaderText": this.str().DocumentHeaderText = (string)value; break;							
						case "DocumentDate": this.str().DocumentDate = (string)value; break;							
						case "ReferenceTransact": this.str().ReferenceTransact = (string)value; break;							
						case "LogicalSystem": this.str().LogicalSystem = (string)value; break;							
						case "FunctionDept": this.str().FunctionDept = (string)value; break;							
						case "StorageStatus": this.str().StorageStatus = (string)value; break;							
						case "EStorageStatus": this.str().EStorageStatus = (string)value; break;							
						case "StorageLocation": this.str().StorageLocation = (string)value; break;							
						case "SupplierBarcode": this.str().SupplierBarcode = (string)value; break;							
						case "IsSAP": this.str().IsSAP = (string)value; break;							
						case "Comments": this.str().Comments = (string)value; break;							
						case "IsConfirmed": this.str().IsConfirmed = (string)value; break;							
						case "ConfirmedBy": this.str().ConfirmedBy = (string)value; break;							
						case "ConfirmedDttm": this.str().ConfirmedDttm = (string)value; break;							
						case "Division": this.str().Division = (string)value; break;							
						case "FirstStorageDate": this.str().FirstStorageDate = (string)value; break;							
						case "VoucherDate": this.str().VoucherDate = (string)value; break;							
						case "VoucherDescription": this.str().VoucherDescription = (string)value; break;							
						case "TransferRecord": this.str().TransferRecord = (string)value; break;							
						case "LastTransferDate": this.str().LastTransferDate = (string)value; break;							
						case "DocumentSystem": this.str().DocumentSystem = (string)value; break;							
						case "CreatedBy": this.str().CreatedBy = (string)value; break;							
						case "CreatedDttm": this.str().CreatedDttm = (string)value; break;							
						case "UpdatedBy": this.str().UpdatedBy = (string)value; break;							
						case "UpdatedDttm": this.str().UpdatedDttm = (string)value; break;							
						case "VersionNo": this.str().VersionNo = (string)value; break;							
						case "TransactionID": this.str().TransactionID = (string)value; break;							
						case "BoxID": this.str().BoxID = (string)value; break;							
						case "DestoryDate": this.str().DestoryDate = (string)value; break;							
						case "HisIndexStart": this.str().HisIndexStart = (string)value; break;							
						case "HisIndexEnd": this.str().HisIndexEnd = (string)value; break;							
						case "HisDocumentStartDate": this.str().HisDocumentStartDate = (string)value; break;							
						case "HisDocumentEndDate": this.str().HisDocumentEndDate = (string)value; break;							
						case "StoreStartDate": this.str().StoreStartDate = (string)value; break;							
						case "NeedStoreYear": this.str().NeedStoreYear = (string)value; break;							
						case "UploadId": this.str().UploadId = (string)value; break;							
						case "CompanyNo": this.str().CompanyNo = (string)value; break;							
						case "CompanyName": this.str().CompanyName = (string)value; break;							
						case "EntryDate": this.str().EntryDate = (string)value; break;							
						case "UploadUserName": this.str().UploadUserName = (string)value; break;							
						case "UploadDateTime": this.str().UploadDateTime = (string)value; break;							
						case "EStorageLocation": this.str().EStorageLocation = (string)value; break;							
						case "ManageUser": this.str().ManageUser = (string)value; break;							
						case "IsDeleted": this.str().IsDeleted = (string)value; break;							
						case "ThirdUnitCabinId": this.str().ThirdUnitCabinId = (string)value; break;							
						case "ThirdUnitNumberId": this.str().ThirdUnitNumberId = (string)value; break;							
						case "IsHis": this.str().IsHis = (string)value; break;							
						case "LendId": this.str().LendId = (string)value; break;							
						case "UpdateCount": this.str().UpdateCount = (string)value; break;							
						case "DeleteReason": this.str().DeleteReason = (string)value; break;
					}
				}
				else
				{
					switch (name)
					{	
						case "ReceiptID":
						
							if (value == null || value is System.Decimal)
								this.ReceiptID = (System.Decimal?)value;
								OnPropertyChanged(FinReceiptMetadata.PropertyNames.ReceiptID);
							break;
						
						case "PostingDate":
						
							if (value == null || value is System.DateTime)
								this.PostingDate = (System.DateTime?)value;
								OnPropertyChanged(FinReceiptMetadata.PropertyNames.PostingDate);
							break;
						
						case "ReverseDate":
						
							if (value == null || value is System.DateTime)
								this.ReverseDate = (System.DateTime?)value;
								OnPropertyChanged(FinReceiptMetadata.PropertyNames.ReverseDate);
							break;
						
						case "DocumentDate":
						
							if (value == null || value is System.DateTime)
								this.DocumentDate = (System.DateTime?)value;
								OnPropertyChanged(FinReceiptMetadata.PropertyNames.DocumentDate);
							break;
						
						case "StorageLocation":
						
							if (value == null || value is System.Decimal)
								this.StorageLocation = (System.Decimal?)value;
								OnPropertyChanged(FinReceiptMetadata.PropertyNames.StorageLocation);
							break;
						
						case "IsSAP":
						
							if (value == null || value is System.Boolean)
								this.IsSAP = (System.Boolean?)value;
								OnPropertyChanged(FinReceiptMetadata.PropertyNames.IsSAP);
							break;
						
						case "IsConfirmed":
						
							if (value == null || value is System.Boolean)
								this.IsConfirmed = (System.Boolean?)value;
								OnPropertyChanged(FinReceiptMetadata.PropertyNames.IsConfirmed);
							break;
						
						case "ConfirmedDttm":
						
							if (value == null || value is System.DateTime)
								this.ConfirmedDttm = (System.DateTime?)value;
								OnPropertyChanged(FinReceiptMetadata.PropertyNames.ConfirmedDttm);
							break;
						
						case "FirstStorageDate":
						
							if (value == null || value is System.DateTime)
								this.FirstStorageDate = (System.DateTime?)value;
								OnPropertyChanged(FinReceiptMetadata.PropertyNames.FirstStorageDate);
							break;
						
						case "TransferRecord":
						
							if (value == null || value is System.Int32)
								this.TransferRecord = (System.Int32?)value;
								OnPropertyChanged(FinReceiptMetadata.PropertyNames.TransferRecord);
							break;
						
						case "LastTransferDate":
						
							if (value == null || value is System.DateTime)
								this.LastTransferDate = (System.DateTime?)value;
								OnPropertyChanged(FinReceiptMetadata.PropertyNames.LastTransferDate);
							break;
						
						case "CreatedDttm":
						
							if (value == null || value is System.DateTime)
								this.CreatedDttm = (System.DateTime?)value;
								OnPropertyChanged(FinReceiptMetadata.PropertyNames.CreatedDttm);
							break;
						
						case "UpdatedDttm":
						
							if (value == null || value is System.DateTime)
								this.UpdatedDttm = (System.DateTime?)value;
								OnPropertyChanged(FinReceiptMetadata.PropertyNames.UpdatedDttm);
							break;
						
						case "VersionNo":
						
							if (value == null || value is System.Int32)
								this.VersionNo = (System.Int32?)value;
								OnPropertyChanged(FinReceiptMetadata.PropertyNames.VersionNo);
							break;
						
						case "BoxID":
						
							if (value == null || value is System.Decimal)
								this.BoxID = (System.Decimal?)value;
								OnPropertyChanged(FinReceiptMetadata.PropertyNames.BoxID);
							break;
						
						case "DestoryDate":
						
							if (value == null || value is System.DateTime)
								this.DestoryDate = (System.DateTime?)value;
								OnPropertyChanged(FinReceiptMetadata.PropertyNames.DestoryDate);
							break;
						
						case "StoreStartDate":
						
							if (value == null || value is System.DateTime)
								this.StoreStartDate = (System.DateTime?)value;
								OnPropertyChanged(FinReceiptMetadata.PropertyNames.StoreStartDate);
							break;
						
						case "NeedStoreYear":
						
							if (value == null || value is System.Int32)
								this.NeedStoreYear = (System.Int32?)value;
								OnPropertyChanged(FinReceiptMetadata.PropertyNames.NeedStoreYear);
							break;
						
						case "UploadId":
						
							if (value == null || value is System.Decimal)
								this.UploadId = (System.Decimal?)value;
								OnPropertyChanged(FinReceiptMetadata.PropertyNames.UploadId);
							break;
						
						case "EntryDate":
						
							if (value == null || value is System.DateTime)
								this.EntryDate = (System.DateTime?)value;
								OnPropertyChanged(FinReceiptMetadata.PropertyNames.EntryDate);
							break;
						
						case "UploadDateTime":
						
							if (value == null || value is System.DateTime)
								this.UploadDateTime = (System.DateTime?)value;
								OnPropertyChanged(FinReceiptMetadata.PropertyNames.UploadDateTime);
							break;
						
						case "IsDeleted":
						
							if (value == null || value is System.Boolean)
								this.IsDeleted = (System.Boolean?)value;
								OnPropertyChanged(FinReceiptMetadata.PropertyNames.IsDeleted);
							break;
						
						case "ThirdUnitCabinId":
						
							if (value == null || value is System.Guid)
								this.ThirdUnitCabinId = (System.Guid?)value;
								OnPropertyChanged(FinReceiptMetadata.PropertyNames.ThirdUnitCabinId);
							break;
						
						case "ThirdUnitNumberId":
						
							if (value == null || value is System.Guid)
								this.ThirdUnitNumberId = (System.Guid?)value;
								OnPropertyChanged(FinReceiptMetadata.PropertyNames.ThirdUnitNumberId);
							break;
						
						case "IsHis":
						
							if (value == null || value is System.Boolean)
								this.IsHis = (System.Boolean?)value;
								OnPropertyChanged(FinReceiptMetadata.PropertyNames.IsHis);
							break;
						
						case "LendId":
						
							if (value == null || value is System.Decimal)
								this.LendId = (System.Decimal?)value;
								OnPropertyChanged(FinReceiptMetadata.PropertyNames.LendId);
							break;
						
						case "UpdateCount":
						
							if (value == null || value is System.Int32)
								this.UpdateCount = (System.Int32?)value;
								OnPropertyChanged(FinReceiptMetadata.PropertyNames.UpdateCount);
							break;
					

						default:
							break;
					}
				}
			}
            else if (this.ContainsColumn(name))
            {
                this.SetColumn(name, value);
            }
			else
			{
				throw new Exception("SetProperty Error: '" + name + "' not found");
			}
		}		

		public esStrings str()
		{
			if (esstrings == null)
			{
				esstrings = new esStrings(this);
			}
			return esstrings;
		}

		sealed public class esStrings
		{
			public esStrings(esFinReceipt entity)
			{
				this.entity = entity;
			}
			
	
			public System.String ReceiptID
			{
				get
				{
					System.Decimal? data = entity.ReceiptID;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.ReceiptID = null;
					else entity.ReceiptID = Convert.ToDecimal(value);
				}
			}
				
			public System.String DocumentsNo
			{
				get
				{
					System.String data = entity.DocumentsNo;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.DocumentsNo = null;
					else entity.DocumentsNo = Convert.ToString(value);
				}
			}
				
			public System.String Reference
			{
				get
				{
					System.String data = entity.Reference;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.Reference = null;
					else entity.Reference = Convert.ToString(value);
				}
			}
				
			public System.String ReferenceKey
			{
				get
				{
					System.String data = entity.ReferenceKey;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.ReferenceKey = null;
					else entity.ReferenceKey = Convert.ToString(value);
				}
			}
				
			public System.String DocumentsType
			{
				get
				{
					System.String data = entity.DocumentsType;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.DocumentsType = null;
					else entity.DocumentsType = Convert.ToString(value);
				}
			}
				
			public System.String PostingDate
			{
				get
				{
					System.DateTime? data = entity.PostingDate;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.PostingDate = null;
					else entity.PostingDate = Convert.ToDateTime(value);
				}
			}
				
			public System.String CompanyCode
			{
				get
				{
					System.String data = entity.CompanyCode;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.CompanyCode = null;
					else entity.CompanyCode = Convert.ToString(value);
				}
			}
				
			public System.String RevesedBy
			{
				get
				{
					System.String data = entity.RevesedBy;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.RevesedBy = null;
					else entity.RevesedBy = Convert.ToString(value);
				}
			}
				
			public System.String ReverseDate
			{
				get
				{
					System.DateTime? data = entity.ReverseDate;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.ReverseDate = null;
					else entity.ReverseDate = Convert.ToDateTime(value);
				}
			}
				
			public System.String UserName
			{
				get
				{
					System.String data = entity.UserName;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.UserName = null;
					else entity.UserName = Convert.ToString(value);
				}
			}
				
			public System.String DocumentHeaderText
			{
				get
				{
					System.String data = entity.DocumentHeaderText;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.DocumentHeaderText = null;
					else entity.DocumentHeaderText = Convert.ToString(value);
				}
			}
				
			public System.String DocumentDate
			{
				get
				{
					System.DateTime? data = entity.DocumentDate;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.DocumentDate = null;
					else entity.DocumentDate = Convert.ToDateTime(value);
				}
			}
				
			public System.String ReferenceTransact
			{
				get
				{
					System.String data = entity.ReferenceTransact;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.ReferenceTransact = null;
					else entity.ReferenceTransact = Convert.ToString(value);
				}
			}
				
			public System.String LogicalSystem
			{
				get
				{
					System.String data = entity.LogicalSystem;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.LogicalSystem = null;
					else entity.LogicalSystem = Convert.ToString(value);
				}
			}
				
			public System.String FunctionDept
			{
				get
				{
					System.String data = entity.FunctionDept;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.FunctionDept = null;
					else entity.FunctionDept = Convert.ToString(value);
				}
			}
				
			public System.String StorageStatus
			{
				get
				{
					System.String data = entity.StorageStatus;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.StorageStatus = null;
					else entity.StorageStatus = Convert.ToString(value);
				}
			}
				
			public System.String EStorageStatus
			{
				get
				{
					System.String data = entity.EStorageStatus;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.EStorageStatus = null;
					else entity.EStorageStatus = Convert.ToString(value);
				}
			}
				
			public System.String StorageLocation
			{
				get
				{
					System.Decimal? data = entity.StorageLocation;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.StorageLocation = null;
					else entity.StorageLocation = Convert.ToDecimal(value);
				}
			}
				
			public System.String SupplierBarcode
			{
				get
				{
					System.String data = entity.SupplierBarcode;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.SupplierBarcode = null;
					else entity.SupplierBarcode = Convert.ToString(value);
				}
			}
				
			public System.String IsSAP
			{
				get
				{
					System.Boolean? data = entity.IsSAP;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.IsSAP = null;
					else entity.IsSAP = Convert.ToBoolean(value);
				}
			}
				
			public System.String Comments
			{
				get
				{
					System.String data = entity.Comments;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.Comments = null;
					else entity.Comments = Convert.ToString(value);
				}
			}
				
			public System.String IsConfirmed
			{
				get
				{
					System.Boolean? data = entity.IsConfirmed;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.IsConfirmed = null;
					else entity.IsConfirmed = Convert.ToBoolean(value);
				}
			}
				
			public System.String ConfirmedBy
			{
				get
				{
					System.String data = entity.ConfirmedBy;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.ConfirmedBy = null;
					else entity.ConfirmedBy = Convert.ToString(value);
				}
			}
				
			public System.String ConfirmedDttm
			{
				get
				{
					System.DateTime? data = entity.ConfirmedDttm;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.ConfirmedDttm = null;
					else entity.ConfirmedDttm = Convert.ToDateTime(value);
				}
			}
				
			public System.String Division
			{
				get
				{
					System.String data = entity.Division;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.Division = null;
					else entity.Division = Convert.ToString(value);
				}
			}
				
			public System.String FirstStorageDate
			{
				get
				{
					System.DateTime? data = entity.FirstStorageDate;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.FirstStorageDate = null;
					else entity.FirstStorageDate = Convert.ToDateTime(value);
				}
			}
				
			public System.String VoucherDate
			{
				get
				{
					System.String data = entity.VoucherDate;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.VoucherDate = null;
					else entity.VoucherDate = Convert.ToString(value);
				}
			}
				
			public System.String VoucherDescription
			{
				get
				{
					System.String data = entity.VoucherDescription;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.VoucherDescription = null;
					else entity.VoucherDescription = Convert.ToString(value);
				}
			}
				
			public System.String TransferRecord
			{
				get
				{
					System.Int32? data = entity.TransferRecord;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.TransferRecord = null;
					else entity.TransferRecord = Convert.ToInt32(value);
				}
			}
				
			public System.String LastTransferDate
			{
				get
				{
					System.DateTime? data = entity.LastTransferDate;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.LastTransferDate = null;
					else entity.LastTransferDate = Convert.ToDateTime(value);
				}
			}
				
			public System.String DocumentSystem
			{
				get
				{
					System.String data = entity.DocumentSystem;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.DocumentSystem = null;
					else entity.DocumentSystem = Convert.ToString(value);
				}
			}
				
			public System.String CreatedBy
			{
				get
				{
					System.String data = entity.CreatedBy;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.CreatedBy = null;
					else entity.CreatedBy = Convert.ToString(value);
				}
			}
				
			public System.String CreatedDttm
			{
				get
				{
					System.DateTime? data = entity.CreatedDttm;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.CreatedDttm = null;
					else entity.CreatedDttm = Convert.ToDateTime(value);
				}
			}
				
			public System.String UpdatedBy
			{
				get
				{
					System.String data = entity.UpdatedBy;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.UpdatedBy = null;
					else entity.UpdatedBy = Convert.ToString(value);
				}
			}
				
			public System.String UpdatedDttm
			{
				get
				{
					System.DateTime? data = entity.UpdatedDttm;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.UpdatedDttm = null;
					else entity.UpdatedDttm = Convert.ToDateTime(value);
				}
			}
				
			public System.String VersionNo
			{
				get
				{
					System.Int32? data = entity.VersionNo;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.VersionNo = null;
					else entity.VersionNo = Convert.ToInt32(value);
				}
			}
				
			public System.String TransactionID
			{
				get
				{
					System.String data = entity.TransactionID;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.TransactionID = null;
					else entity.TransactionID = Convert.ToString(value);
				}
			}
				
			public System.String BoxID
			{
				get
				{
					System.Decimal? data = entity.BoxID;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.BoxID = null;
					else entity.BoxID = Convert.ToDecimal(value);
				}
			}
				
			public System.String DestoryDate
			{
				get
				{
					System.DateTime? data = entity.DestoryDate;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.DestoryDate = null;
					else entity.DestoryDate = Convert.ToDateTime(value);
				}
			}
				
			public System.String HisIndexStart
			{
				get
				{
					System.String data = entity.HisIndexStart;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.HisIndexStart = null;
					else entity.HisIndexStart = Convert.ToString(value);
				}
			}
				
			public System.String HisIndexEnd
			{
				get
				{
					System.String data = entity.HisIndexEnd;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.HisIndexEnd = null;
					else entity.HisIndexEnd = Convert.ToString(value);
				}
			}
				
			public System.String HisDocumentStartDate
			{
				get
				{
					System.String data = entity.HisDocumentStartDate;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.HisDocumentStartDate = null;
					else entity.HisDocumentStartDate = Convert.ToString(value);
				}
			}
				
			public System.String HisDocumentEndDate
			{
				get
				{
					System.String data = entity.HisDocumentEndDate;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.HisDocumentEndDate = null;
					else entity.HisDocumentEndDate = Convert.ToString(value);
				}
			}
				
			public System.String StoreStartDate
			{
				get
				{
					System.DateTime? data = entity.StoreStartDate;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.StoreStartDate = null;
					else entity.StoreStartDate = Convert.ToDateTime(value);
				}
			}
				
			public System.String NeedStoreYear
			{
				get
				{
					System.Int32? data = entity.NeedStoreYear;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.NeedStoreYear = null;
					else entity.NeedStoreYear = Convert.ToInt32(value);
				}
			}
				
			public System.String UploadId
			{
				get
				{
					System.Decimal? data = entity.UploadId;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.UploadId = null;
					else entity.UploadId = Convert.ToDecimal(value);
				}
			}
				
			public System.String CompanyNo
			{
				get
				{
					System.String data = entity.CompanyNo;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.CompanyNo = null;
					else entity.CompanyNo = Convert.ToString(value);
				}
			}
				
			public System.String CompanyName
			{
				get
				{
					System.String data = entity.CompanyName;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.CompanyName = null;
					else entity.CompanyName = Convert.ToString(value);
				}
			}
				
			public System.String EntryDate
			{
				get
				{
					System.DateTime? data = entity.EntryDate;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.EntryDate = null;
					else entity.EntryDate = Convert.ToDateTime(value);
				}
			}
				
			public System.String UploadUserName
			{
				get
				{
					System.String data = entity.UploadUserName;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.UploadUserName = null;
					else entity.UploadUserName = Convert.ToString(value);
				}
			}
				
			public System.String UploadDateTime
			{
				get
				{
					System.DateTime? data = entity.UploadDateTime;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.UploadDateTime = null;
					else entity.UploadDateTime = Convert.ToDateTime(value);
				}
			}
				
			public System.String EStorageLocation
			{
				get
				{
					System.String data = entity.EStorageLocation;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.EStorageLocation = null;
					else entity.EStorageLocation = Convert.ToString(value);
				}
			}
				
			public System.String ManageUser
			{
				get
				{
					System.String data = entity.ManageUser;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.ManageUser = null;
					else entity.ManageUser = Convert.ToString(value);
				}
			}
				
			public System.String IsDeleted
			{
				get
				{
					System.Boolean? data = entity.IsDeleted;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.IsDeleted = null;
					else entity.IsDeleted = Convert.ToBoolean(value);
				}
			}
				
			public System.String ThirdUnitCabinId
			{
				get
				{
					System.Guid? data = entity.ThirdUnitCabinId;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.ThirdUnitCabinId = null;
					else entity.ThirdUnitCabinId = new Guid(value);
				}
			}
				
			public System.String ThirdUnitNumberId
			{
				get
				{
					System.Guid? data = entity.ThirdUnitNumberId;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.ThirdUnitNumberId = null;
					else entity.ThirdUnitNumberId = new Guid(value);
				}
			}
				
			public System.String IsHis
			{
				get
				{
					System.Boolean? data = entity.IsHis;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.IsHis = null;
					else entity.IsHis = Convert.ToBoolean(value);
				}
			}
				
			public System.String LendId
			{
				get
				{
					System.Decimal? data = entity.LendId;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.LendId = null;
					else entity.LendId = Convert.ToDecimal(value);
				}
			}
				
			public System.String UpdateCount
			{
				get
				{
					System.Int32? data = entity.UpdateCount;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.UpdateCount = null;
					else entity.UpdateCount = Convert.ToInt32(value);
				}
			}
				
			public System.String DeleteReason
			{
				get
				{
					System.String data = entity.DeleteReason;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.DeleteReason = null;
					else entity.DeleteReason = Convert.ToString(value);
				}
			}
			

			private esFinReceipt entity;
		}
		
		[NonSerialized]
		private esStrings esstrings;		
		
		#endregion
		
		#region Housekeeping methods

		override protected IMetadata Meta
		{
			get
			{
				return FinReceiptMetadata.Meta();
			}
		}

		#endregion		
		
		#region Query Logic

		public FinReceiptQuery Query
		{
			get
			{
				if (this.query == null)
				{
					this.query = new FinReceiptQuery();
					InitQuery(this.query);
				}

				return this.query;
			}
		}

		public bool Load(FinReceiptQuery query)
		{
			this.query = query;
			InitQuery(this.query);
			return this.Query.Load();
		}
		
		protected void InitQuery(FinReceiptQuery query)
		{
			query.OnLoadDelegate = this.OnQueryLoaded;
			
			if (!query.es2.HasConnection)
			{
				query.es2.Connection = ((IEntity)this).Connection;
			}			
		}

		#endregion
		
        [IgnoreDataMember]
		private FinReceiptQuery query;		
	}



	[Serializable]
	abstract public partial class esFinReceiptCollection : esEntityCollection<FinReceipt>
	{
		#region Housekeeping methods
		override protected IMetadata Meta
		{
			get
			{
				return FinReceiptMetadata.Meta();
			}
		}

		protected override string GetCollectionName()
		{
			return "FinReceiptCollection";
		}

		#endregion		
		
		#region Query Logic

	#if (!WindowsCE)
		[BrowsableAttribute(false)]
	#endif
		public FinReceiptQuery Query
		{
			get
			{
				if (this.query == null)
				{
					this.query = new FinReceiptQuery();
					InitQuery(this.query);
				}

				return this.query;
			}
		}

		public bool Load(FinReceiptQuery query)
		{
			this.query = query;
			InitQuery(this.query);
			return Query.Load();
		}

		override protected esDynamicQuery GetDynamicQuery()
		{
			if (this.query == null)
			{
				this.query = new FinReceiptQuery();
				this.InitQuery(query);
			}
			return this.query;
		}

		protected void InitQuery(FinReceiptQuery query)
		{
			query.OnLoadDelegate = this.OnQueryLoaded;
			
			if (!query.es2.HasConnection)
			{
				query.es2.Connection = ((IEntityCollection)this).Connection;
			}			
		}

		protected override void HookupQuery(esDynamicQuery query)
		{
			this.InitQuery((FinReceiptQuery)query);
		}

		#endregion
		
		private FinReceiptQuery query;
	}



	[Serializable]
	abstract public partial class esFinReceiptQuery : esDynamicQuery
	{
		override protected IMetadata Meta
		{
			get
			{
				return FinReceiptMetadata.Meta();
			}
		}	
		
		#region QueryItemFromName
		
        protected override esQueryItem QueryItemFromName(string name)
        {
            switch (name)
            {
				case "ReceiptID": return this.ReceiptID;
				case "DocumentsNo": return this.DocumentsNo;
				case "Reference": return this.Reference;
				case "ReferenceKey": return this.ReferenceKey;
				case "DocumentsType": return this.DocumentsType;
				case "PostingDate": return this.PostingDate;
				case "CompanyCode": return this.CompanyCode;
				case "RevesedBy": return this.RevesedBy;
				case "ReverseDate": return this.ReverseDate;
				case "UserName": return this.UserName;
				case "DocumentHeaderText": return this.DocumentHeaderText;
				case "DocumentDate": return this.DocumentDate;
				case "ReferenceTransact": return this.ReferenceTransact;
				case "LogicalSystem": return this.LogicalSystem;
				case "FunctionDept": return this.FunctionDept;
				case "StorageStatus": return this.StorageStatus;
				case "EStorageStatus": return this.EStorageStatus;
				case "StorageLocation": return this.StorageLocation;
				case "SupplierBarcode": return this.SupplierBarcode;
				case "IsSAP": return this.IsSAP;
				case "Comments": return this.Comments;
				case "IsConfirmed": return this.IsConfirmed;
				case "ConfirmedBy": return this.ConfirmedBy;
				case "ConfirmedDttm": return this.ConfirmedDttm;
				case "Division": return this.Division;
				case "FirstStorageDate": return this.FirstStorageDate;
				case "VoucherDate": return this.VoucherDate;
				case "VoucherDescription": return this.VoucherDescription;
				case "TransferRecord": return this.TransferRecord;
				case "LastTransferDate": return this.LastTransferDate;
				case "DocumentSystem": return this.DocumentSystem;
				case "CreatedBy": return this.CreatedBy;
				case "CreatedDttm": return this.CreatedDttm;
				case "UpdatedBy": return this.UpdatedBy;
				case "UpdatedDttm": return this.UpdatedDttm;
				case "VersionNo": return this.VersionNo;
				case "TransactionID": return this.TransactionID;
				case "BoxID": return this.BoxID;
				case "DestoryDate": return this.DestoryDate;
				case "HisIndexStart": return this.HisIndexStart;
				case "HisIndexEnd": return this.HisIndexEnd;
				case "HisDocumentStartDate": return this.HisDocumentStartDate;
				case "HisDocumentEndDate": return this.HisDocumentEndDate;
				case "StoreStartDate": return this.StoreStartDate;
				case "NeedStoreYear": return this.NeedStoreYear;
				case "UploadId": return this.UploadId;
				case "CompanyNo": return this.CompanyNo;
				case "CompanyName": return this.CompanyName;
				case "EntryDate": return this.EntryDate;
				case "UploadUserName": return this.UploadUserName;
				case "UploadDateTime": return this.UploadDateTime;
				case "EStorageLocation": return this.EStorageLocation;
				case "ManageUser": return this.ManageUser;
				case "IsDeleted": return this.IsDeleted;
				case "ThirdUnitCabinId": return this.ThirdUnitCabinId;
				case "ThirdUnitNumberId": return this.ThirdUnitNumberId;
				case "IsHis": return this.IsHis;
				case "LendId": return this.LendId;
				case "UpdateCount": return this.UpdateCount;
				case "DeleteReason": return this.DeleteReason;

                default: return null;
            }
        }		
		
		#endregion
		
		#region esQueryItems

		public esQueryItem ReceiptID
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.ReceiptID, esSystemType.Decimal); }
		} 
		
		public esQueryItem DocumentsNo
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.DocumentsNo, esSystemType.String); }
		} 
		
		public esQueryItem Reference
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.Reference, esSystemType.String); }
		} 
		
		public esQueryItem ReferenceKey
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.ReferenceKey, esSystemType.String); }
		} 
		
		public esQueryItem DocumentsType
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.DocumentsType, esSystemType.String); }
		} 
		
		public esQueryItem PostingDate
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.PostingDate, esSystemType.DateTime); }
		} 
		
		public esQueryItem CompanyCode
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.CompanyCode, esSystemType.String); }
		} 
		
		public esQueryItem RevesedBy
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.RevesedBy, esSystemType.String); }
		} 
		
		public esQueryItem ReverseDate
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.ReverseDate, esSystemType.DateTime); }
		} 
		
		public esQueryItem UserName
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.UserName, esSystemType.String); }
		} 
		
		public esQueryItem DocumentHeaderText
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.DocumentHeaderText, esSystemType.String); }
		} 
		
		public esQueryItem DocumentDate
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.DocumentDate, esSystemType.DateTime); }
		} 
		
		public esQueryItem ReferenceTransact
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.ReferenceTransact, esSystemType.String); }
		} 
		
		public esQueryItem LogicalSystem
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.LogicalSystem, esSystemType.String); }
		} 
		
		public esQueryItem FunctionDept
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.FunctionDept, esSystemType.String); }
		} 
		
		public esQueryItem StorageStatus
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.StorageStatus, esSystemType.String); }
		} 
		
		public esQueryItem EStorageStatus
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.EStorageStatus, esSystemType.String); }
		} 
		
		public esQueryItem StorageLocation
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.StorageLocation, esSystemType.Decimal); }
		} 
		
		public esQueryItem SupplierBarcode
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.SupplierBarcode, esSystemType.String); }
		} 
		
		public esQueryItem IsSAP
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.IsSAP, esSystemType.Boolean); }
		} 
		
		public esQueryItem Comments
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.Comments, esSystemType.String); }
		} 
		
		public esQueryItem IsConfirmed
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.IsConfirmed, esSystemType.Boolean); }
		} 
		
		public esQueryItem ConfirmedBy
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.ConfirmedBy, esSystemType.String); }
		} 
		
		public esQueryItem ConfirmedDttm
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.ConfirmedDttm, esSystemType.DateTime); }
		} 
		
		public esQueryItem Division
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.Division, esSystemType.String); }
		} 
		
		public esQueryItem FirstStorageDate
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.FirstStorageDate, esSystemType.DateTime); }
		} 
		
		public esQueryItem VoucherDate
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.VoucherDate, esSystemType.String); }
		} 
		
		public esQueryItem VoucherDescription
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.VoucherDescription, esSystemType.String); }
		} 
		
		public esQueryItem TransferRecord
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.TransferRecord, esSystemType.Int32); }
		} 
		
		public esQueryItem LastTransferDate
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.LastTransferDate, esSystemType.DateTime); }
		} 
		
		public esQueryItem DocumentSystem
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.DocumentSystem, esSystemType.String); }
		} 
		
		public esQueryItem CreatedBy
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.CreatedBy, esSystemType.String); }
		} 
		
		public esQueryItem CreatedDttm
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.CreatedDttm, esSystemType.DateTime); }
		} 
		
		public esQueryItem UpdatedBy
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.UpdatedBy, esSystemType.String); }
		} 
		
		public esQueryItem UpdatedDttm
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.UpdatedDttm, esSystemType.DateTime); }
		} 
		
		public esQueryItem VersionNo
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.VersionNo, esSystemType.Int32); }
		} 
		
		public esQueryItem TransactionID
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.TransactionID, esSystemType.String); }
		} 
		
		public esQueryItem BoxID
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.BoxID, esSystemType.Decimal); }
		} 
		
		public esQueryItem DestoryDate
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.DestoryDate, esSystemType.DateTime); }
		} 
		
		public esQueryItem HisIndexStart
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.HisIndexStart, esSystemType.String); }
		} 
		
		public esQueryItem HisIndexEnd
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.HisIndexEnd, esSystemType.String); }
		} 
		
		public esQueryItem HisDocumentStartDate
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.HisDocumentStartDate, esSystemType.String); }
		} 
		
		public esQueryItem HisDocumentEndDate
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.HisDocumentEndDate, esSystemType.String); }
		} 
		
		public esQueryItem StoreStartDate
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.StoreStartDate, esSystemType.DateTime); }
		} 
		
		public esQueryItem NeedStoreYear
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.NeedStoreYear, esSystemType.Int32); }
		} 
		
		public esQueryItem UploadId
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.UploadId, esSystemType.Decimal); }
		} 
		
		public esQueryItem CompanyNo
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.CompanyNo, esSystemType.String); }
		} 
		
		public esQueryItem CompanyName
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.CompanyName, esSystemType.String); }
		} 
		
		public esQueryItem EntryDate
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.EntryDate, esSystemType.DateTime); }
		} 
		
		public esQueryItem UploadUserName
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.UploadUserName, esSystemType.String); }
		} 
		
		public esQueryItem UploadDateTime
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.UploadDateTime, esSystemType.DateTime); }
		} 
		
		public esQueryItem EStorageLocation
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.EStorageLocation, esSystemType.String); }
		} 
		
		public esQueryItem ManageUser
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.ManageUser, esSystemType.String); }
		} 
		
		public esQueryItem IsDeleted
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.IsDeleted, esSystemType.Boolean); }
		} 
		
		public esQueryItem ThirdUnitCabinId
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.ThirdUnitCabinId, esSystemType.Guid); }
		} 
		
		public esQueryItem ThirdUnitNumberId
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.ThirdUnitNumberId, esSystemType.Guid); }
		} 
		
		public esQueryItem IsHis
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.IsHis, esSystemType.Boolean); }
		} 
		
		public esQueryItem LendId
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.LendId, esSystemType.Decimal); }
		} 
		
		public esQueryItem UpdateCount
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.UpdateCount, esSystemType.Int32); }
		} 
		
		public esQueryItem DeleteReason
		{
			get { return new esQueryItem(this, FinReceiptMetadata.ColumnNames.DeleteReason, esSystemType.String); }
		} 
		
		#endregion
		
	}


	
	public partial class FinReceipt : esFinReceipt
	{

		#region FinLendReceiptCollectionByReceiptID - Zero To Many
		
		static public esPrefetchMap Prefetch_FinLendReceiptCollectionByReceiptID
		{
			get
			{
				esPrefetchMap map = new esPrefetchMap();
				map.PrefetchDelegate = yncTech.BusinessObjects.FinReceipt.FinLendReceiptCollectionByReceiptID_Delegate;
				map.PropertyName = "FinLendReceiptCollectionByReceiptID";
				map.MyColumnName = "ReceiptID";
				map.ParentColumnName = "ReceiptID";
				map.IsMultiPartKey = false;
				return map;
			}
		}		
		
		static private void FinLendReceiptCollectionByReceiptID_Delegate(esPrefetchParameters data)
		{
			FinReceiptQuery parent = new FinReceiptQuery(data.NextAlias());

			FinLendReceiptQuery me = data.You != null ? data.You as FinLendReceiptQuery : new FinLendReceiptQuery(data.NextAlias());

			if (data.Root == null)
			{
				data.Root = me;
			}
			
			data.Root.InnerJoin(parent).On(parent.ReceiptID == me.ReceiptID);

			data.You = parent;
		}			
		
		/// <summary>
		/// Zero to Many
		/// Foreign Key Name - FK_FIN_LEND_REFERENCE_FIN_RECE
		/// </summary>

		[XmlIgnore]
		public FinLendReceiptCollection FinLendReceiptCollectionByReceiptID
		{
			get
			{
				if(this._FinLendReceiptCollectionByReceiptID == null)
				{
					this._FinLendReceiptCollectionByReceiptID = new FinLendReceiptCollection();
					this._FinLendReceiptCollectionByReceiptID.es.Connection.Name = this.es.Connection.Name;
					this.SetPostSave("FinLendReceiptCollectionByReceiptID", this._FinLendReceiptCollectionByReceiptID);
				
					if (this.ReceiptID != null)
					{
						if (!this.es.IsLazyLoadDisabled)
						{
							this._FinLendReceiptCollectionByReceiptID.Query.Where(this._FinLendReceiptCollectionByReceiptID.Query.ReceiptID == this.ReceiptID);
							this._FinLendReceiptCollectionByReceiptID.Query.Load();
						}

						// Auto-hookup Foreign Keys
						this._FinLendReceiptCollectionByReceiptID.fks.Add(FinLendReceiptMetadata.ColumnNames.ReceiptID, this.ReceiptID);
					}
				}

				return this._FinLendReceiptCollectionByReceiptID;
			}
			
			set 
			{ 
				if (value != null) throw new Exception("'value' Must be null"); 
			 
				if (this._FinLendReceiptCollectionByReceiptID != null) 
				{ 
					this.RemovePostSave("FinLendReceiptCollectionByReceiptID"); 
					this._FinLendReceiptCollectionByReceiptID = null;
					
				} 
			} 			
		}
			
		
		private FinLendReceiptCollection _FinLendReceiptCollectionByReceiptID;
		#endregion

		
		protected override esEntityCollectionBase CreateCollectionForPrefetch(string name)
		{
			esEntityCollectionBase coll = null;

			switch (name)
			{
				case "FinLendReceiptCollectionByReceiptID":
					coll = this.FinLendReceiptCollectionByReceiptID;
					break;	
			}

			return coll;
		}		
		/// <summary>
		/// Used internally by the entity's hierarchical properties.
		/// </summary>
		protected override List<esPropertyDescriptor> GetHierarchicalProperties()
		{
			List<esPropertyDescriptor> props = new List<esPropertyDescriptor>();
			
			props.Add(new esPropertyDescriptor(this, "FinLendReceiptCollectionByReceiptID", typeof(FinLendReceiptCollection), new FinLendReceipt()));
		
			return props;
		}
		
		/// <summary>
		/// Called by ApplyPostSaveKeys 
		/// </summary>
		/// <param name="coll">The collection to enumerate over</param>
		/// <param name="key">"The column name</param>
		/// <param name="value">The column value</param>
		private void Apply(esEntityCollectionBase coll, string key, object value)
		{
			foreach (esEntity obj in coll)
			{
				if (obj.es.IsAdded)
				{
					obj.SetProperty(key, value);
				}
			}
		}
		
		/// <summary>
		/// Used internally for retrieving AutoIncrementing keys
		/// during hierarchical PostSave.
		/// </summary>
		protected override void ApplyPostSaveKeys()
		{
			if(this._FinLendReceiptCollectionByReceiptID != null)
			{
				Apply(this._FinLendReceiptCollectionByReceiptID, "ReceiptID", this.ReceiptID);
			}
		}
		
	}
	



	[Serializable]
	public partial class FinReceiptMetadata : esMetadata, IMetadata
	{
		#region Protected Constructor
		protected FinReceiptMetadata()
		{
			m_columns = new esColumnMetadataCollection();
			esColumnMetadata c;

			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.ReceiptID, 0, typeof(System.Decimal), esSystemType.Decimal);
			c.PropertyName = FinReceiptMetadata.PropertyNames.ReceiptID;
			c.IsInPrimaryKey = true;
			c.IsAutoIncrement = true;
			c.NumericPrecision = 18;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.DocumentsNo, 1, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.DocumentsNo;
			c.CharacterMaxLength = 40;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.Reference, 2, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.Reference;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.ReferenceKey, 3, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.ReferenceKey;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.DocumentsType, 4, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.DocumentsType;
			c.CharacterMaxLength = 20;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.PostingDate, 5, typeof(System.DateTime), esSystemType.DateTime);
			c.PropertyName = FinReceiptMetadata.PropertyNames.PostingDate;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.CompanyCode, 6, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.CompanyCode;
			c.CharacterMaxLength = 30;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.RevesedBy, 7, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.RevesedBy;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.ReverseDate, 8, typeof(System.DateTime), esSystemType.DateTime);
			c.PropertyName = FinReceiptMetadata.PropertyNames.ReverseDate;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.UserName, 9, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.UserName;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.DocumentHeaderText, 10, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.DocumentHeaderText;
			c.CharacterMaxLength = 200;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.DocumentDate, 11, typeof(System.DateTime), esSystemType.DateTime);
			c.PropertyName = FinReceiptMetadata.PropertyNames.DocumentDate;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.ReferenceTransact, 12, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.ReferenceTransact;
			c.CharacterMaxLength = 20;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.LogicalSystem, 13, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.LogicalSystem;
			c.CharacterMaxLength = 20;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.FunctionDept, 14, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.FunctionDept;
			c.CharacterMaxLength = 20;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.StorageStatus, 15, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.StorageStatus;
			c.CharacterMaxLength = 20;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.EStorageStatus, 16, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.EStorageStatus;
			c.CharacterMaxLength = 20;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.StorageLocation, 17, typeof(System.Decimal), esSystemType.Decimal);
			c.PropertyName = FinReceiptMetadata.PropertyNames.StorageLocation;
			c.NumericPrecision = 18;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.SupplierBarcode, 18, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.SupplierBarcode;
			c.CharacterMaxLength = 40;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.IsSAP, 19, typeof(System.Boolean), esSystemType.Boolean);
			c.PropertyName = FinReceiptMetadata.PropertyNames.IsSAP;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.Comments, 20, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.Comments;
			c.CharacterMaxLength = 500;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.IsConfirmed, 21, typeof(System.Boolean), esSystemType.Boolean);
			c.PropertyName = FinReceiptMetadata.PropertyNames.IsConfirmed;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.ConfirmedBy, 22, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.ConfirmedBy;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.ConfirmedDttm, 23, typeof(System.DateTime), esSystemType.DateTime);
			c.PropertyName = FinReceiptMetadata.PropertyNames.ConfirmedDttm;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.Division, 24, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.Division;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.FirstStorageDate, 25, typeof(System.DateTime), esSystemType.DateTime);
			c.PropertyName = FinReceiptMetadata.PropertyNames.FirstStorageDate;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.VoucherDate, 26, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.VoucherDate;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.VoucherDescription, 27, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.VoucherDescription;
			c.CharacterMaxLength = 500;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.TransferRecord, 28, typeof(System.Int32), esSystemType.Int32);
			c.PropertyName = FinReceiptMetadata.PropertyNames.TransferRecord;
			c.NumericPrecision = 10;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.LastTransferDate, 29, typeof(System.DateTime), esSystemType.DateTime);
			c.PropertyName = FinReceiptMetadata.PropertyNames.LastTransferDate;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.DocumentSystem, 30, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.DocumentSystem;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.CreatedBy, 31, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.CreatedBy;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.CreatedDttm, 32, typeof(System.DateTime), esSystemType.DateTime);
			c.PropertyName = FinReceiptMetadata.PropertyNames.CreatedDttm;
			c.HasDefault = true;
			c.Default = @"(getdate())";
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.UpdatedBy, 33, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.UpdatedBy;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.UpdatedDttm, 34, typeof(System.DateTime), esSystemType.DateTime);
			c.PropertyName = FinReceiptMetadata.PropertyNames.UpdatedDttm;
			c.HasDefault = true;
			c.Default = @"(getdate())";
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.VersionNo, 35, typeof(System.Int32), esSystemType.Int32);
			c.PropertyName = FinReceiptMetadata.PropertyNames.VersionNo;
			c.NumericPrecision = 10;
			c.HasDefault = true;
			c.Default = @"((0))";
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.TransactionID, 36, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.TransactionID;
			c.CharacterMaxLength = 36;
			c.HasDefault = true;
			c.Default = @"(newid())";
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.BoxID, 37, typeof(System.Decimal), esSystemType.Decimal);
			c.PropertyName = FinReceiptMetadata.PropertyNames.BoxID;
			c.NumericPrecision = 18;
			c.HasDefault = true;
			c.Default = @"((-1))";
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.DestoryDate, 38, typeof(System.DateTime), esSystemType.DateTime);
			c.PropertyName = FinReceiptMetadata.PropertyNames.DestoryDate;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.HisIndexStart, 39, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.HisIndexStart;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.HisIndexEnd, 40, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.HisIndexEnd;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.HisDocumentStartDate, 41, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.HisDocumentStartDate;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.HisDocumentEndDate, 42, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.HisDocumentEndDate;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.StoreStartDate, 43, typeof(System.DateTime), esSystemType.DateTime);
			c.PropertyName = FinReceiptMetadata.PropertyNames.StoreStartDate;
			c.CharacterMaxLength = 10;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.NeedStoreYear, 44, typeof(System.Int32), esSystemType.Int32);
			c.PropertyName = FinReceiptMetadata.PropertyNames.NeedStoreYear;
			c.NumericPrecision = 10;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.UploadId, 45, typeof(System.Decimal), esSystemType.Decimal);
			c.PropertyName = FinReceiptMetadata.PropertyNames.UploadId;
			c.NumericPrecision = 18;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.CompanyNo, 46, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.CompanyNo;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.CompanyName, 47, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.CompanyName;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.EntryDate, 48, typeof(System.DateTime), esSystemType.DateTime);
			c.PropertyName = FinReceiptMetadata.PropertyNames.EntryDate;
			c.CharacterMaxLength = 10;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.UploadUserName, 49, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.UploadUserName;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.UploadDateTime, 50, typeof(System.DateTime), esSystemType.DateTime);
			c.PropertyName = FinReceiptMetadata.PropertyNames.UploadDateTime;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.EStorageLocation, 51, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.EStorageLocation;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.ManageUser, 52, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.ManageUser;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.IsDeleted, 53, typeof(System.Boolean), esSystemType.Boolean);
			c.PropertyName = FinReceiptMetadata.PropertyNames.IsDeleted;
			c.HasDefault = true;
			c.Default = @"((0))";
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.ThirdUnitCabinId, 54, typeof(System.Guid), esSystemType.Guid);
			c.PropertyName = FinReceiptMetadata.PropertyNames.ThirdUnitCabinId;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.ThirdUnitNumberId, 55, typeof(System.Guid), esSystemType.Guid);
			c.PropertyName = FinReceiptMetadata.PropertyNames.ThirdUnitNumberId;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.IsHis, 56, typeof(System.Boolean), esSystemType.Boolean);
			c.PropertyName = FinReceiptMetadata.PropertyNames.IsHis;
			c.HasDefault = true;
			c.Default = @"((0))";
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.LendId, 57, typeof(System.Decimal), esSystemType.Decimal);
			c.PropertyName = FinReceiptMetadata.PropertyNames.LendId;
			c.NumericPrecision = 18;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.UpdateCount, 58, typeof(System.Int32), esSystemType.Int32);
			c.PropertyName = FinReceiptMetadata.PropertyNames.UpdateCount;
			c.NumericPrecision = 10;
			c.HasDefault = true;
			c.Default = @"((0))";
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinReceiptMetadata.ColumnNames.DeleteReason, 59, typeof(System.String), esSystemType.String);
			c.PropertyName = FinReceiptMetadata.PropertyNames.DeleteReason;
			c.CharacterMaxLength = 500;
			c.IsNullable = true;
			m_columns.Add(c);
				
		}
		#endregion	
	
		static public FinReceiptMetadata Meta()
		{
			return meta;
		}	
		
		public Guid DataID
		{
			get { return base.m_dataID; }
		}	
		
		public bool MultiProviderMode
		{
			get { return false; }
		}		

		public esColumnMetadataCollection Columns
		{
			get	{ return base.m_columns; }
		}
		
		#region ColumnNames
		public class ColumnNames
		{ 
			 public const string ReceiptID = "ReceiptID";
			 public const string DocumentsNo = "DocumentsNo";
			 public const string Reference = "Reference";
			 public const string ReferenceKey = "ReferenceKey";
			 public const string DocumentsType = "DocumentsType";
			 public const string PostingDate = "PostingDate";
			 public const string CompanyCode = "CompanyCode";
			 public const string RevesedBy = "RevesedBy";
			 public const string ReverseDate = "ReverseDate";
			 public const string UserName = "UserName";
			 public const string DocumentHeaderText = "DocumentHeaderText";
			 public const string DocumentDate = "DocumentDate";
			 public const string ReferenceTransact = "ReferenceTransact";
			 public const string LogicalSystem = "LogicalSystem";
			 public const string FunctionDept = "FunctionDept";
			 public const string StorageStatus = "StorageStatus";
			 public const string EStorageStatus = "EStorageStatus";
			 public const string StorageLocation = "StorageLocation";
			 public const string SupplierBarcode = "SupplierBarcode";
			 public const string IsSAP = "IsSAP";
			 public const string Comments = "Comments";
			 public const string IsConfirmed = "IsConfirmed";
			 public const string ConfirmedBy = "ConfirmedBy";
			 public const string ConfirmedDttm = "ConfirmedDttm";
			 public const string Division = "Division";
			 public const string FirstStorageDate = "FirstStorageDate";
			 public const string VoucherDate = "VoucherDate";
			 public const string VoucherDescription = "VoucherDescription";
			 public const string TransferRecord = "TransferRecord";
			 public const string LastTransferDate = "LastTransferDate";
			 public const string DocumentSystem = "DocumentSystem";
			 public const string CreatedBy = "CreatedBy";
			 public const string CreatedDttm = "CreatedDttm";
			 public const string UpdatedBy = "UpdatedBy";
			 public const string UpdatedDttm = "UpdatedDttm";
			 public const string VersionNo = "VersionNo";
			 public const string TransactionID = "TransactionID";
			 public const string BoxID = "BoxID";
			 public const string DestoryDate = "DestoryDate";
			 public const string HisIndexStart = "HisIndexStart";
			 public const string HisIndexEnd = "HisIndexEnd";
			 public const string HisDocumentStartDate = "HisDocumentStartDate";
			 public const string HisDocumentEndDate = "HisDocumentEndDate";
			 public const string StoreStartDate = "StoreStartDate";
			 public const string NeedStoreYear = "NeedStoreYear";
			 public const string UploadId = "UploadId";
			 public const string CompanyNo = "CompanyNo";
			 public const string CompanyName = "CompanyName";
			 public const string EntryDate = "EntryDate";
			 public const string UploadUserName = "UploadUserName";
			 public const string UploadDateTime = "UploadDateTime";
			 public const string EStorageLocation = "EStorageLocation";
			 public const string ManageUser = "ManageUser";
			 public const string IsDeleted = "IsDeleted";
			 public const string ThirdUnitCabinId = "ThirdUnitCabinId";
			 public const string ThirdUnitNumberId = "ThirdUnitNumberId";
			 public const string IsHis = "IsHis";
			 public const string LendId = "LendId";
			 public const string UpdateCount = "UpdateCount";
			 public const string DeleteReason = "DeleteReason";
		}
		#endregion	
		
		#region PropertyNames
		public class PropertyNames
		{ 
			 public const string ReceiptID = "ReceiptID";
			 public const string DocumentsNo = "DocumentsNo";
			 public const string Reference = "Reference";
			 public const string ReferenceKey = "ReferenceKey";
			 public const string DocumentsType = "DocumentsType";
			 public const string PostingDate = "PostingDate";
			 public const string CompanyCode = "CompanyCode";
			 public const string RevesedBy = "RevesedBy";
			 public const string ReverseDate = "ReverseDate";
			 public const string UserName = "UserName";
			 public const string DocumentHeaderText = "DocumentHeaderText";
			 public const string DocumentDate = "DocumentDate";
			 public const string ReferenceTransact = "ReferenceTransact";
			 public const string LogicalSystem = "LogicalSystem";
			 public const string FunctionDept = "FunctionDept";
			 public const string StorageStatus = "StorageStatus";
			 public const string EStorageStatus = "EStorageStatus";
			 public const string StorageLocation = "StorageLocation";
			 public const string SupplierBarcode = "SupplierBarcode";
			 public const string IsSAP = "IsSAP";
			 public const string Comments = "Comments";
			 public const string IsConfirmed = "IsConfirmed";
			 public const string ConfirmedBy = "ConfirmedBy";
			 public const string ConfirmedDttm = "ConfirmedDttm";
			 public const string Division = "Division";
			 public const string FirstStorageDate = "FirstStorageDate";
			 public const string VoucherDate = "VoucherDate";
			 public const string VoucherDescription = "VoucherDescription";
			 public const string TransferRecord = "TransferRecord";
			 public const string LastTransferDate = "LastTransferDate";
			 public const string DocumentSystem = "DocumentSystem";
			 public const string CreatedBy = "CreatedBy";
			 public const string CreatedDttm = "CreatedDttm";
			 public const string UpdatedBy = "UpdatedBy";
			 public const string UpdatedDttm = "UpdatedDttm";
			 public const string VersionNo = "VersionNo";
			 public const string TransactionID = "TransactionID";
			 public const string BoxID = "BoxID";
			 public const string DestoryDate = "DestoryDate";
			 public const string HisIndexStart = "HisIndexStart";
			 public const string HisIndexEnd = "HisIndexEnd";
			 public const string HisDocumentStartDate = "HisDocumentStartDate";
			 public const string HisDocumentEndDate = "HisDocumentEndDate";
			 public const string StoreStartDate = "StoreStartDate";
			 public const string NeedStoreYear = "NeedStoreYear";
			 public const string UploadId = "UploadId";
			 public const string CompanyNo = "CompanyNo";
			 public const string CompanyName = "CompanyName";
			 public const string EntryDate = "EntryDate";
			 public const string UploadUserName = "UploadUserName";
			 public const string UploadDateTime = "UploadDateTime";
			 public const string EStorageLocation = "EStorageLocation";
			 public const string ManageUser = "ManageUser";
			 public const string IsDeleted = "IsDeleted";
			 public const string ThirdUnitCabinId = "ThirdUnitCabinId";
			 public const string ThirdUnitNumberId = "ThirdUnitNumberId";
			 public const string IsHis = "IsHis";
			 public const string LendId = "LendId";
			 public const string UpdateCount = "UpdateCount";
			 public const string DeleteReason = "DeleteReason";
		}
		#endregion	

		public esProviderSpecificMetadata GetProviderMetadata(string mapName)
		{
			MapToMeta mapMethod = mapDelegates[mapName];

			if (mapMethod != null)
				return mapMethod(mapName);
			else
				return null;
		}
		
		#region MAP esDefault
		
		static private int RegisterDelegateesDefault()
		{
			// This is only executed once per the life of the application
			lock (typeof(FinReceiptMetadata))
			{
				if(FinReceiptMetadata.mapDelegates == null)
				{
					FinReceiptMetadata.mapDelegates = new Dictionary<string,MapToMeta>();
				}
				
				if (FinReceiptMetadata.meta == null)
				{
					FinReceiptMetadata.meta = new FinReceiptMetadata();
				}
				
				MapToMeta mapMethod = new MapToMeta(meta.esDefault);
				mapDelegates.Add("esDefault", mapMethod);
				mapMethod("esDefault");
			}
			return 0;
		}			

		private esProviderSpecificMetadata esDefault(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();			


				meta.AddTypeMap("ReceiptID", new esTypeMap("numeric", "System.Decimal"));
				meta.AddTypeMap("DocumentsNo", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("Reference", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("ReferenceKey", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("DocumentsType", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("PostingDate", new esTypeMap("datetime", "System.DateTime"));
				meta.AddTypeMap("CompanyCode", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("RevesedBy", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("ReverseDate", new esTypeMap("datetime", "System.DateTime"));
				meta.AddTypeMap("UserName", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("DocumentHeaderText", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("DocumentDate", new esTypeMap("datetime", "System.DateTime"));
				meta.AddTypeMap("ReferenceTransact", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("LogicalSystem", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("FunctionDept", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("StorageStatus", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("EStorageStatus", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("StorageLocation", new esTypeMap("numeric", "System.Decimal"));
				meta.AddTypeMap("SupplierBarcode", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("IsSAP", new esTypeMap("bit", "System.Boolean"));
				meta.AddTypeMap("Comments", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("IsConfirmed", new esTypeMap("bit", "System.Boolean"));
				meta.AddTypeMap("ConfirmedBy", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("ConfirmedDttm", new esTypeMap("datetime", "System.DateTime"));
				meta.AddTypeMap("Division", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("FirstStorageDate", new esTypeMap("datetime", "System.DateTime"));
				meta.AddTypeMap("VoucherDate", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("VoucherDescription", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("TransferRecord", new esTypeMap("int", "System.Int32"));
				meta.AddTypeMap("LastTransferDate", new esTypeMap("datetime", "System.DateTime"));
				meta.AddTypeMap("DocumentSystem", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("CreatedBy", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("CreatedDttm", new esTypeMap("datetime", "System.DateTime"));
				meta.AddTypeMap("UpdatedBy", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("UpdatedDttm", new esTypeMap("datetime", "System.DateTime"));
				meta.AddTypeMap("VersionNo", new esTypeMap("int", "System.Int32"));
				meta.AddTypeMap("TransactionID", new esTypeMap("char", "System.String"));
				meta.AddTypeMap("BoxID", new esTypeMap("numeric", "System.Decimal"));
				meta.AddTypeMap("DestoryDate", new esTypeMap("datetime", "System.DateTime"));
				meta.AddTypeMap("HisIndexStart", new esTypeMap("varchar", "System.String"));
				meta.AddTypeMap("HisIndexEnd", new esTypeMap("varchar", "System.String"));
				meta.AddTypeMap("HisDocumentStartDate", new esTypeMap("varchar", "System.String"));
				meta.AddTypeMap("HisDocumentEndDate", new esTypeMap("varchar", "System.String"));
				meta.AddTypeMap("StoreStartDate", new esTypeMap("date", "System.DateTime"));
				meta.AddTypeMap("NeedStoreYear", new esTypeMap("int", "System.Int32"));
				meta.AddTypeMap("UploadId", new esTypeMap("numeric", "System.Decimal"));
				meta.AddTypeMap("CompanyNo", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("CompanyName", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("EntryDate", new esTypeMap("date", "System.DateTime"));
				meta.AddTypeMap("UploadUserName", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("UploadDateTime", new esTypeMap("datetime", "System.DateTime"));
				meta.AddTypeMap("EStorageLocation", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("ManageUser", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("IsDeleted", new esTypeMap("bit", "System.Boolean"));
				meta.AddTypeMap("ThirdUnitCabinId", new esTypeMap("uniqueidentifier", "System.Guid"));
				meta.AddTypeMap("ThirdUnitNumberId", new esTypeMap("uniqueidentifier", "System.Guid"));
				meta.AddTypeMap("IsHis", new esTypeMap("bit", "System.Boolean"));
				meta.AddTypeMap("LendId", new esTypeMap("numeric", "System.Decimal"));
				meta.AddTypeMap("UpdateCount", new esTypeMap("int", "System.Int32"));
				meta.AddTypeMap("DeleteReason", new esTypeMap("nvarchar", "System.String"));			
				
				
				
				meta.Source = "Fin_Receipt";
				meta.Destination = "Fin_Receipt";
				
				meta.spInsert = "proc_Fin_ReceiptInsert";				
				meta.spUpdate = "proc_Fin_ReceiptUpdate";		
				meta.spDelete = "proc_Fin_ReceiptDelete";
				meta.spLoadAll = "proc_Fin_ReceiptLoadAll";
				meta.spLoadByPrimaryKey = "proc_Fin_ReceiptLoadByPrimaryKey";
				
				this.m_providerMetadataMaps["esDefault"] = meta;
			}
			
			return this.m_providerMetadataMaps["esDefault"];
		}

		#endregion

		static private FinReceiptMetadata meta;
		static protected Dictionary<string, MapToMeta> mapDelegates;
		static private int _esDefault = RegisterDelegateesDefault();
	}
}
